#include "service_frame.h"

service_frame::service_frame()
{

}

service_frame::~service_frame()
{

}

void service_frame::initialize()
{
    m_buffered_server.init();
    m_buffered_server.listen(80);
    m_buffered_server.set_cb(this);
}

void service_frame::set_trace_mod(file_logger *tracer)
{
    m_tracer = tracer;
    m_buffered_server.set_trace_mod(tracer);
}

void service_frame::cb_buffer_tcp_server_accepted(tcp_session &session)
{

}

void service_frame::cb_buffer_tcp_server_readed(tcp_session &session, const char *data, int nsize)
{
    session.write("hello world", (int)strlen("hello world")+1);
    session.close();
}

void service_frame::cb_buffer_tcp_server_closed(tcp_session &session)
{

}
